Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TP2000-1463 Support SQLite dump on DBT Platform #1281

Merged

Conversation

paulpepper-trade
Copy link
Collaborator

TP2000-1463 Support SQLite dump on DBT Platform

Why

The SQLite dump process fails on DBT Platform deployments because of file write access restrictions under an application’s deployment directory.

Both django-dotenv and python-dotenv rely upon the same import dotenv, causing a conflict when dependended-upon packages rely upon python-dotenv.

What

This PR:

  • Adds support to generate and execute SQLite migration source files under a system's temporary file storage directory. Copilot-based service deployments run under /tmp, while all other deployments do not do so by default - the env var SQLITE_MIGRATIONS_IN_TMP_DIR may be set to True to force /tmp directory behaviour.

  • Switches from using the django-dotenv package to the more ubiquitous python-dotenv package to load .env file variables into the applications shell environment. This increases the chances of other packages that rely upon python-dotenv to work with Tamato.

Checklist

  • Requires migrations? No
  • Requires dependency updates? yes

Both django-dotenv and python-dotenv rely upon the same `import dotenv`, causing a conflict when dependended-upon packages rely upon python-dotenv. Therefore use the more popular and ubiquitous python-dotenv package, reducing the likelihood of conflict.
Add support to generate and execute SQLite migration source files under a system's temporary file storage directory. Copilot-based service deployments run under /tmp while all other deployments do not do so by default - the env var SQLITE_MIGRATIONS_IN_TMP_DIR may be set to True to force /tmp directory behaviour.
@paulpepper-trade paulpepper-trade marked this pull request as ready for review September 17, 2024 11:28
@paulpepper-trade paulpepper-trade requested a review from a team as a code owner September 17, 2024 11:28
file.unlink()


def try_as_octal(decimal: int):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this function still intended to be used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was being used and now it's not. Now removed.

@paulpepper-trade paulpepper-trade merged commit 31fc85a into master Sep 17, 2024
8 checks passed
@paulpepper-trade paulpepper-trade deleted the TP2000-1463--sqlite-dump-incompatible-with-dbt-platform branch September 17, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants